package model.information;

import java.io.Serializable;
import java.util.Observable;

/**
 * A class that represents a saved password.
 * @author Tobias Møller Kjærsgaard
 * @author Hjalte Blichfeldt Flyger
 * @author Gitte Simonsen
 * @author Claus Lund
 */
public class Password extends Observable implements Serializable {
    private String title;
    private String username;
    private String password;

    public Password(String title, String username, String password) {
        this.title = title;
        this.username = username;
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
        this.setChanged();
        this.notifyObservers("password");
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
        this.setChanged();
        this.notifyObservers("password");
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
        this.setChanged();
        this.notifyObservers("password");
    }

    @Override
    public String toString() {
        return title;
    }
}